Imports System.Xml.Serialization
Namespace CSDL

    Public Class FunctionImportParameter
        Inherits XEntityModelElementWithDocumentationBase

        ''' <summary>Initializes an instance of the <see cref="FunctionImportParameter" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("Parameter", EdmXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="FunctionImportParameter" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        <XmlAttribute()> _
        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property Type() As String
            Get
                Return Me.@Type
            End Get
            Set(ByVal value As String)
                Me.@Type = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property Mode() As ParameterMode
            Get
                Return GetEnumValueAttribute(GetType(ParameterMode), Me.Attribute(XName.Get("Mode", MyBase.Name.NamespaceName)))
            End Get
            Set(ByVal value As ParameterMode)
                If (Me.Attribute(XName.Get("Mode", MyBase.Name.NamespaceName)) Is Nothing) Then
                    Me.Add(New XAttribute(XName.Get("Mode", MyBase.Name.NamespaceName), ""))
                End If
                SetEnumValueAttribute(GetType(ParameterMode), Me.Attribute(XName.Get("Mode", MyBase.Name.NamespaceName)), value)
            End Set
        End Property

        <XmlAttribute()> _
        Public Property MaxLength() As Integer
            Get
                If (Me.@MaxLength = "Max") Then
                    Return -1
                End If
                Return Me.@MaxLength
            End Get
            Set(ByVal value As Integer)
                If (value = -1) Then
                    Me.@MaxLength = "Max"
                Else
                    Me.@MaxLength = value
                End If
            End Set
        End Property

        <XmlAttribute(DataType:="nonNegativeInteger")> _
        Public Property Precision() As Integer
            Get
                Return Me.@Precision
            End Get
            Set(ByVal value As Integer)
                Me.@Precision = value
            End Set
        End Property

        <XmlAttribute(DataType:="nonNegativeInteger")> _
        Public Property Scale() As Integer
            Get
                Return Me.@Scale
            End Get
            Set(ByVal value As Integer)
                Me.@Scale = value
            End Set
        End Property

    End Class

End Namespace